﻿using StandXunYouServer.IRepository;
using StandXunYouServer.IServices;
using StandXunYouServer.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StandXunYouServer.Services
{
    public class LoginServices : ILoginServices
    {

        private readonly IBaseRepository _baseConn;

        public LoginServices(IBaseRepository baseConn)
        {
            _baseConn = baseConn;
        }

        public async Task<Users> GetUserQueryAsync(string userId)
        {
            var sql = "select * from Users where UserName =@userName";

            var model = await _baseConn.QueryFirstOrDefaultAsync<Users>(sql, new { userName = userId });
            return model;
        }


    }
}
